import { Define, EntityObjectFactory } from 'tiny-entity2';
import { Page } from './page';
const EntityObjectType = EntityObjectFactory.GetEntityObjectType(process.env.dataBaseType || 'mysql');
@Define.Table({ TableName: "flownode" })
export class FlowNode extends EntityObjectType<FlowNode>{
    @Define.PrimaryKey({
        DataLength: 32
    })
    id: string;

    /**
     * 流程id
     *
     * @type {string}
     * @memberof FlowNode
     */
    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        NotAllowNULL: true,
        IsIndex: true
    })
    workflowId: string;

    /**
     * 节点名称
     *
     * @type {string}
     * @memberof FlowNode
     */
    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        NotAllowNULL: true,
    })
    name: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
    })
    type: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
    })
    status: string;

    @Define.Column({
        DataType: Define.DataType.BIGINT,
    })
    beginTime: number;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
    })
    endTime: number;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
    })
    updateTime: number;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
    })
    permitId: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
    })
    permitName: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
    })
    permitGroupName:string;


    @Define.Mapping({
        Mapping: 'Page',
        MappingKey: 'flowNodeId'
    })
    pages: Page[]
}